// 导入
import { defineStore } from "pinia";
import { ref } from "vue";
const useUserInfoStore = defineStore("userInfo", () => {
// 
const info = ref({});
const userType=ref({});

// 设置用户信息
const setInfo = (newInfo) => {
  info.value = newInfo;
};
// 设置用户类型
const setUserType = (newUserType) => {
  userType.value = newUserType;
};
// 移除用户信息
const removeInfo = () => {
  info.value = {};
};
// 移除用户类型
const removeUserType = () => {
  userType.value = {};
};
return {
  info,
  setInfo,
  removeInfo,
  userType,
  setUserType,
  removeUserType,

};

},
{
  persist: true,
}
);

export default useUserInfoStore;